package com.cskaoyan.controller.admin;

import com.cskaoyan.model.admin.vo.BaseRespVo;
import com.cskaoyan.model.admin.vo.StatGoodsRespVO;
import com.cskaoyan.model.admin.vo.StatOrderRespVO;
import com.cskaoyan.model.admin.vo.StatUserRespVO;
import com.cskaoyan.service.admin.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: StatController
 * @Author: WangEnzhao
 * @Description: 统计报表模块
 * @CreateTime: 2021/11/11:43:00
 */
@RestController
@RequestMapping("admin/stat")
public class StatController {

    @Autowired
    StatService statService;


    /**
    * @Author: WangEnzhao
    * @Description: 统计用户模块
    * @CreateTime:
    * @Param:
    * @return:
    **/
    @RequestMapping("user")
    public BaseRespVo selectStatUser(){
        StatUserRespVO statUserRespVO = statService.selectStatUser();
        return BaseRespVo.ok(statUserRespVO);
    }

    /**
    * @Author: WangEnzhao
    * @Description: 统计订单模块
    * @CreateTime:
    * @Param:
    * @return:
    **/
    @RequestMapping("order")
    public BaseRespVo selectStatOrder(){
        StatOrderRespVO statOrderRespVO = statService.selectStatOrder();
        return BaseRespVo.ok(statOrderRespVO);
    }

    /**
    * @Author: WangEnzhao
    * @Description: 统计商品模块
    * @CreateTime:
    * @Param:
    * @return:
    **/
    @RequestMapping("goods")
    public BaseRespVo selectStatGoods(){
        StatGoodsRespVO statGoodsRespVO = statService.selectStatGoods();
        return BaseRespVo.ok(statGoodsRespVO);
    }

}
